Handle comments in eshell-read-hosts-file (tiny change)
authorMike Lamb <mrlamb@gmail.com>
Mon, 23 Jan 2012 08:12:10 +0000 (00:12 -0800)
committerGlenn Morris <rgm@gnu.org>
Mon, 23 Jan 2012 08:12:10 +0000 (00:12 -0800)
* lisp/eshell/esh-util.el (eshell-read-hosts-file): Skip comment lines.

lisp/ChangeLog
lisp/eshell/esh-util.el

index 3d2b30226c2ba802b6cd82ac2c6bad36aeb746b6..0ea2acbdf90b5d5da8f62a09fad121a4cb18b0c0 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-23  Mike Lamb  <mrlamb@gmail.com>  (tiny change)
+
+       * eshell/esh-util.el (eshell-read-hosts-file):
+       Skip comment lines.  (Bug#10549)
+
 2012-01-23  Juanma Barranquero  <lekktu@gmail.com>
 
        * subr.el (display-delayed-warnings): Doc fix.
index f111fd912307c76b61868f31d2604f85ab54661b..8218e91ddc7273386d626ebfcacf6f02e3822e75 100644 (file)
@@ -483,7 +483,7 @@ list."
       (insert-file-contents eshell-hosts-file)
       (goto-char (point-min))
       (while (re-search-forward
-             "^\\(\\S-+\\)\\s-+\\(\\S-+\\)\\(\\s-*\\(\\S-+\\)\\)?" nil t)
+             "^\\([^#[:space:]]+\\)\\s-+\\(\\S-+\\)\\(\\s-*\\(\\S-+\\)\\)?" nil t)
        (if (match-string 1)
            (add-to-list 'hosts (match-string 1)))
        (if (match-string 2)